<?php
$this->headLink()->appendStylesheet($this->baseUrl('widget/dataTable/css/dataTables.css'));
$this->headScript()->appendFile($this->baseUrl('widget/dataTable/js/jquery.dataTables.min.js'));
$this->headScript()->appendFile($this->baseUrl('widget/dataTable/js/initDataTables.js'));

$this->placeholder("navegacion")->set($this->navegacion($this->nav));
$domConfig = Zend_Registry::get('domConfig');

$perfil = App_Perfil::getInstance();
$perfil->cargar("ACREDITAR_PROG_PREG");
if (!$perfil->modificar()){
    $this->form1->makeStatic();
    $this->form2->makeStatic();
}
?>
<br/>
<table width="100%" align="center" class="iceDatTbl">
<tr>
	<th>Código SNIES</th>
	<th>Nombre - Lugar ofrecimiento</th>
	<th>Título</th>
	<th>Metodología - Nivel</th>
	<th>Fecha vencimiento RC </th>
</tr>
 <TR class="iceDatTblRow1">
   <TD style="text-align:center;"><?php echo $this->infoPrograma[0]["codsnies"];?></TD>
   <TD align=left><?php echo $this->infoPrograma[0]["nombreprograma"]?><br/><?php echo $this->infoPrograma[0]["ubicacion"]?></TD>
   <TD align=left><?php echo $this->infoPrograma[0]["titulo"]?></TD>
   <TD align=left><?php echo $this->infoPrograma[0]["nombremetodologia"]."<br/>".$this->infoPrograma[0]["nombrenivel"]?></TD>
   <TD align=left><?php echo $this->infoPrograma[0]["fechavencimientorc"]?></TD>
 </TR>
</table>
<br/>
<?php
$this->placeholder( 'contenttab' )->captureStart();
echo $this->botonesHorizontales->renderElement();
?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><H3>M&eacute;todos de ponderaci&oacute;n y gradaci&oacute;n</H3></td>
  </tr>
</table>
<br/>
<div align="center">
<div style="width: 800px">
	<table id="table_form1" align="center" class="display">
		<thead>
			<tr><th>Justificaci&oacute;n m&eacute;todos de ponderaci&oacute;n y escala de gradaci&oacute;n</th></tr>
		</thead>
		<tbody>
			<tr><td>
			<?php
				$this->form1->setAction($this->baseUrl("/solicitudes/detalleautoevaluacion/guardarmetodos"));
				echo $this->form1;
			?>
			</td></tr>
		</tbody>
	</table>
</div>
</div>

<script type="text/javascript">
$(function() {
	var oTable = $('#table_form1').dataTable({
		"bJQueryUI": true,
		"bAutoWidth": false,
		"paging":   false,
        "ordering": false,
        "info":     false,
        "searching": false,
 		"aoColumns": [
 	 		 			{ "bSortable": false, "bSearchable": false }

 	 		 		 ]
 	 		  		
	});
});
</script>
<br />

<div align="center">
<br></br>
<table align="center" class="iceDatTbl">
  <thead>
    <tr><th colspan="6">Modelo CNA - Escala de Gradaci&oacute;n</th></tr>
    <tr>
      <th width="50%" rowspan="2">Grado de cumplimiento</th>
      <th width="10%" rowspan="2">Gradación no numérica</th>
      <th width="20%" colspan="2">Gradación numérica</th>
      <th width="20%" colspan="2">Valor porcentaje</th>
    </tr>
    <tr>
      <th>desde</th>
      <th>hasta</th>
      <th>desde</th>
      <th>hasta</th>
    </tr>
  </thead>
  <tbody>
		    <tr>
      <td>NO SE CUMPLE</td>
      <td style="text-align:center;">E</td>
      <td style="text-align:center;">desde 1</td>
      <td style="text-align:center;">hasta 1.9</td>
      <td style="text-align:center;">desde 10</td>
      <td style="text-align:center;">hasta 19</td>
    </tr>
  	    <tr>
      <td>SE CUMPLE INSATISFACTORIAMENTE</td>
      <td style="text-align:center;">D</td>
      <td style="text-align:center;">desde 2</td>
      <td style="text-align:center;">hasta 2.9</td>
      <td style="text-align:center;">desde 20</td>
      <td style="text-align:center;">hasta 39</td>
    </tr>
  	    <tr>
      <td>SE CUMPLE ACEPTABLEMENTE</td>
      <td style="text-align:center;">C</td>
      <td style="text-align:center;">desde 3</td>
      <td style="text-align:center;">hasta 3.4</td>
      <td style="text-align:center;">desde 40</td>
      <td style="text-align:center;">hasta 59</td>
    </tr>
  	    <tr>
      <td>SE CUMPLE EN ALTO GRADO</td>
      <td style="text-align:center;">B</td>
      <td style="text-align:center;">desde 3.5</td>
      <td style="text-align:center;">hasta 4.4</td>
      <td style="text-align:center;">desde 60</td>
      <td style="text-align:center;">hasta 79</td>
    </tr>
  	    <tr>
      <td>SE CUMPLE PLENAMENTE</td>
      <td style="text-align:center;">A</td>
      <td style="text-align:center;">desde 4.5</td>
      <td style="text-align:center;">hasta 5</td>
      <td style="text-align:center;">desde 80</td>
      <td style="text-align:center;">hasta 100</td>
    </tr>
    </tbody>
</table>
<div style="width: 800px">
<br></br>
<?php if(count($this->datos)==0 ):?>
<table width="95%" align="center" class="iceDatTbl">
<tr>
	<th><a href="<?=$this->baseUrl("/solicitudes/detalleautoevaluacion/guardarcnaescalas");?>" title="Modificar">Utilizar modelo de escalas de gradaci&oacute;n CNA</a></th>
</tr>
</table>
<?php endif; ?>

<div align="center">
<div style="width: 800px">
	<table id="table_form2" align="center" class="display">
		<thead>
			<tr><th>Informaci&oacute;n de la escala de gradaci&oacute;n</th></tr>
		</thead>
		<tbody>
			<tr><td>
			<?php
			$this->form2->setAction($this->baseUrl("/solicitudes/detalleautoevaluacion/guardarescalas"));
			echo $this->form2;
			?>
			</td></tr>
		</tbody>
	</table>
</div>
</div>

<script type="text/javascript">
$(function() {
	var oTable = $('#table_form2').dataTable({
		"bJQueryUI": true,
		"bAutoWidth": false,
		"paging":   false,
        "ordering": false,
        "info":     false,
        "searching": false,
 		"aoColumns": [
 	 		 			{ "bSortable": false, "bSearchable": false }

 	 		 		 ]
 	 		  		
	});
});
</script>

</div>
</div>
</div>
</div>
<br />
<?php if(count($this->datos)>0 ): ?>
<table align="center" class="iceDatTbl zebra">
  <thead>
    <tr>
      <th width="40%" rowspan="2">Grado de cumplimiento</th>
      <th width="10%" rowspan="2">Gradación no numérica</th>
      <th width="20%" colspan="2">Gradación numérica</th>
      <th width="20%" colspan="2">Valor porcentaje</th>
      <th width="10%" rowspan="2">Acciones</th>
    </tr>
    <tr>
      <th>desde</th>
      <th>hasta</th>
      <th>desde</th>
      <th>hasta</th>
    </tr>
  </thead>
  <tbody>
	<?php foreach ($this->datos as $index => $value):?>
	<?php
		$paramsM=App_Util_SafeUrl::encriptar(array("codescala"=>$value["codescala"],"opcion"=>4),true);
		$paramsE=App_Util_SafeUrl::encriptar(array("codescala"=>$value["codescala"]),true);
	?>
    <tr>
      <td><?php echo $value["nombre"]; ?></td>
      <td style="text-align:center;"><?php echo $value["gradononumerico"]; ?></td>
      <td style="text-align:center;"><?php echo ($value["pesoinferior"]!="")?"desde {$value["pesoinferior"]}":""; ?></td>
      <td style="text-align:center;"><?php echo ($value["pesosuperior"]!="")?"hasta {$value["pesosuperior"]}":""; ?></td>
      <td style="text-align:center;"><?php echo ($value["porcentajeinferior"]!="")?"desde {$value["porcentajeinferior"]}":""; ?></td>
      <td style="text-align:center;"><?php echo ($value["porcentajesuperior"]!="")?"hasta {$value["porcentajesuperior"]}":""; ?></td>
      <td>
        <?php
        $tools = new App_Util_ToolButton();
        $tools->addEdit($this->baseUrl("/solicitudes/detalleautoevaluacion/metodologia/{$paramsM}"),$perfil->modificar());
         $tools->addDelete($this->baseUrl("/solicitudes/detalleautoevaluacion/eliminarescala/{$paramsE}"),$perfil->eliminar());
        echo $tools->render();
        ?>
      </td>
    </tr>
  <?php  endforeach;?>
  </tbody>
</table>
<?php else:?>
<br/>
<?php echo $this->mensajes("No existen escalas de gradación");?>
<?php endif;?>




<?php
$this->placeholder( 'contenttab' )->captureEnd();
$this->tabs->contenido($this->placeholder( 'contenttab' ));
echo $this->tabs->renderElement();
?>